<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterRecordPaysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('record_pays')){
            Schema::table('record_pays', function(Blueprint $table){
                if (!Schema::hasColumn('record_pays', 'tables')){
                    $table->string('tables',190)->index()->default('orders')->comment('来源表名');
                }
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
